if exists (select 1
            from  sysobjects
           where  id = object_id('bd_kq_schedule_detail')
            and   type = 'U')
   drop table bd_kq_schedule_detail
go

/*==============================================================*/
/* Table: bd_kq_schedule_detail                                 */
/*==============================================================*/
create table bd_kq_schedule_detail (
   id                   bigint               identity,
   user_serial          bigint               not null,
   shift_id             int                  not null default 0,
   shift_name           varchar(30)          null,
   shift_date           date                 not null,
   shift_begin          int                  not null default 0,
   shift_end            int                  not null default 0,
   shift_sign_begin     int                  not null default 0,
   shift_sign_end       int                  null,
   shift_late           int                  null,
   shift_early          int                  null,
   shift_duty_on_delay  int                  null,
   shift_duty_off_delay int                  null,
   shift_workday        int                  null,
   shift_workday_hours  int                  null,
   is_enjoyment_subsidized int                  null,
   middle_shift_start_time int                  null,
   middle_shift_end_time int                  null,
   night_shift_start_time int                  null,
   night_shift_end_time int                  null,
   repast_start_time    int                  null,
   repast_end_time      int                  null,
   repast_start_time2   int                  null,
   repast_end_time2     int                  null,
   shift_is_rest        int                  null,
   constraint PK_BD_KQ_SCHEDULE_DETAIL primary key (id)
)
go
